package com.ruoyi.agentExpend.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.agentExpend.mapper.AgentExpendMapper;
import com.ruoyi.agentExpend.domain.AgentExpend;
import com.ruoyi.agentExpend.service.IAgentExpendService;

/**
 * 代理商消费明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-21
 */
@Service
public class AgentExpendServiceImpl implements IAgentExpendService 
{
    @Autowired
    private AgentExpendMapper agentExpendMapper;

    /**
     * 查询代理商消费明细
     * 
     * @param id 代理商消费明细主键
     * @return 代理商消费明细
     */
    @Override
    public AgentExpend selectAgentExpendById(Long id)
    {
        return agentExpendMapper.selectAgentExpendById(id);
    }

    /**
     * 查询代理商消费明细列表
     * 
     * @param agentExpend 代理商消费明细
     * @return 代理商消费明细
     */
    @Override
    public List<AgentExpend> selectAgentExpendList(AgentExpend agentExpend)
    {
        return agentExpendMapper.selectAgentExpendList(agentExpend);
    }

    /**
     * 新增代理商消费明细
     * 
     * @param agentExpend 代理商消费明细
     * @return 结果
     */
    @Override
    public int insertAgentExpend(AgentExpend agentExpend)
    {
        agentExpend.setCreateTime(DateUtils.getNowDate());
        return agentExpendMapper.insertAgentExpend(agentExpend);
    }

    /**
     * 修改代理商消费明细
     * 
     * @param agentExpend 代理商消费明细
     * @return 结果
     */
    @Override
    public int updateAgentExpend(AgentExpend agentExpend)
    {
        agentExpend.setUpdateTime(DateUtils.getNowDate());
        return agentExpendMapper.updateAgentExpend(agentExpend);
    }

    /**
     * 批量删除代理商消费明细
     * 
     * @param ids 需要删除的代理商消费明细主键
     * @return 结果
     */
    @Override
    public int deleteAgentExpendByIds(Long[] ids)
    {
        return agentExpendMapper.deleteAgentExpendByIds(ids);
    }

    /**
     * 删除代理商消费明细信息
     * 
     * @param id 代理商消费明细主键
     * @return 结果
     */
    @Override
    public int deleteAgentExpendById(Long id)
    {
        return agentExpendMapper.deleteAgentExpendById(id);
    }
}
